package com.webchat.rmi.pgc.mall;


import com.webchat.common.bean.APIResponseBean;
import com.webchat.domain.vo.request.mall.ShopSubmitRequestVO;
import com.webchat.domain.vo.response.mall.MallShopBaseVO;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "webchat-pgc-service",
        contextId = "mallShopClient",
        configuration = RpcRequestInterceptor.class)
public interface MallShopClient {


    /**
     * 申请开店/更新店铺信息
     *
     * @param requestVO
     * @return
     */
    @PostMapping("/pgc-service/mall/shop/submit")
    APIResponseBean<Long> submit(@RequestBody ShopSubmitRequestVO requestVO);

    /**
     * 查询账号下管理的店铺信息
     *
     * @param userId
     * @return
     */
    @GetMapping("/pgc-service/mall/shop/manageInfo/{userId}")
    APIResponseBean<MallShopBaseVO> manageShopInfo(@PathVariable String userId);

    @GetMapping("/pgc-service/mall/shop/manageShopId/{userId}")
    APIResponseBean<Long> manageShopId(@PathVariable String userId);

    /**
     * 查询店铺信息
     *
     * @param shopId
     * @return
     */
    @GetMapping("/pgc-service/mall/shop/info/{shopId}")
    APIResponseBean<MallShopBaseVO> shopInfo(@PathVariable Long shopId);

    /**
     * 批量查询店铺信息
     *
     * @param shopIdList
     * @return
     */
    @PostMapping("/pgc-service/mall/shop/batchGet")
    APIResponseBean<List<MallShopBaseVO>> batchGetShopListInfo(@RequestBody List<Long> shopIdList);

}
